package com.ruoyi.common.enums;

/**
 * 登录类型枚举
 */
public enum LoginType {
    PASSWORD("password", "账号密码登录"),
    SMS_CODE("smsCode", "短信验证码登录");

    private final String code;
    private final String info;

    LoginType(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public String getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static LoginType getByCode(String code) {
        for (LoginType type : values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        return PASSWORD;
    }
}
